45b2f9
@@ -420,7 +420,9 @@
private void checkPartitionDirs(Path basePath, Set<Path> allDirs, int maxDepth)
           + ((ThreadPoolExecutor) pool).getPoolSize());
     }
     checkPartitionDirs(pool, basePaths, dirSet, basePath.getFileSystem(conf), maxDepth, maxDepth);
-    pool.shutdown();
+    if (pool != null) {
+      pool.shutdown();
+    }
     allDirs.addAll(dirSet);
   }
 
